<!DOCTYPE html>
<html>
<head>
    <title>修改配置</title>
    $css()
    <style>
        .form2 .fl div.label{width:150px;}
        .form2 .fl div.in{margin-left:150px;}
    </style>

</head>
<body>
    <div class="form form2" id="form1" style="padding: 20px">
        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>基本
        </div>
        <div class="fl">
            <div class="label">
                <span class="red">*</span>站点URL：
            </div>
            <div class="in">
                <label>
                    <input v-model="data.SiteUrl" type="text" class="tb_normal ui-box ui-validate" placeholder="如:https://fze.net"/>
                </label>
                <div class="tip">站点网址,包含https或http</div>
            </div>
        </div>
        
        
        <div class="title" style="margin-top: 0">
            <span class="icon icon1"></span>百度设置
        </div>
        <div class="fl">
            <div class="label"><span class="red">*</span>URL提交准入密钥：</div>
            <div class="in">
                <label>
                    <input v-model="data.BaiduSiteToken" type="text" class="tb_normal ui-box"/>
                </label>
                <div class="tip">点击<a target="_blank" href="https://ziyuan.baidu.com/linksubmit/index">获取</a>百度的提交准入密钥</div>
            </div>
        </div>
      
        <div class="fl">
            <div class="label"></div>
            <div class="in">
                <span class="ui-button w100" id="btn_save">
                    <span class="button-inner">
                        <a href="javascript:void(0)"></a>
                        <span class="button-txt">保存</span>
                    </span>
                </span>
            </div>
        </div>

        <div class="btnarea" style="padding-left: 58px; padding-top: 25px;">
        </div>
    </div>
</div>
    $js()
    <script type="text/javascript" src="/public/mui/js/vue.min.js"></script>
    <script type="text/javascript">

        const app = Vue.createApp({
            setup: ()=>{
                const data = Vue.ref(${data});
                return {
                    data,
                }
            }
        }).mount('#form1');
        
        window.saveData = function () {
            if (cms.validator.validate('form1')) {
                jr.xhr.post(location.href, app.data, function (json) {
                    if (json.result) {
                        showMsg2(json.message,function(){location.reload();});
                    } else {
                        showErr(json.message,2000);
                    }
                });
            }
        };

        cms.$('btn_save').onclick = window.saveData;
    </script>

</body>
</html>
